package spms.data;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import spms.data.entity.Icon;
import spms.data.entity.Menu;
import spms.data.entity.User;
import spms.util.Page;

import java.util.List;

@FeignClient(value = "spms-data", fallback = SpmsDataRemoteApiFallback.class)
public interface SpmsDataRemoteApi {

    @GetMapping("/icon/findAll")
    List<Icon> findIconAll();

    @GetMapping("/icon/findPage")
    Page<Icon> findIconPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize);

    @PostMapping("/icon/addIcon")
    boolean addIcon(@RequestBody Icon icon);

    @GetMapping("/menu/findAll")
    List<Menu> findMenuAll();

    @GetMapping("/menu/findPage")
    Page<Menu> findMenuPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize);

    @GetMapping("/user/findAll")
    List<User> findUserAll();

    @GetMapping(value = "/user/findByUserId")
    Object findByUserId(@RequestParam Integer id);

    @GetMapping(value = "/user/findPage")
    Page<User> findUserPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize);
}
